﻿namespace EAL.Misc
{
    using System;
    using System.Net;

    class Reporting
    {
        public bool SendFeedback(String msg, String contact)
        {
            bool success = true;
            try
            {
                String url = System.Configuration.ConfigurationManager.AppSettings["FeedbackReportingUrl"];
                WebRequest.Create(url + "?msg=" + msg + "&contact=" + contact).GetResponse();
            }
            catch (Exception)
            {
                success = false;
            }
            return success;
        }

        public bool SendError(Exception e)
        {
            bool success = true;
            try
            {
                String url = System.Configuration.ConfigurationManager.AppSettings["ErrorReportingUrl"];
                WebRequest.Create(url + "?e=" + e.Message).GetResponse();
            }
            catch (Exception)
            {
                success = false;
            }
            return success;
        }
    }
}
